cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project(PythonInterpreterDetection VERSION 1.0.0 LANGUAGES NONE)

find_package(PythonInterp REQUIRED)
# find_package(Python)

if (PYTHONINTERP_FOUND)
    message(STATUS "Found Python interpreter: ${PYTHON_EXECUTABLE} (version ${PYTHON_VERSION_STRING})")
    execute_process(COMMAND 
                    "${PYTHON_EXECUTABLE}" -c "import sys; print(sys.version_info); print('Hello from CMake using Python!')"
                    RESULT_VARIABLE _python_exec_status
                    OUTPUT_VARIABLE _python_exec_output
                    ERROR_QUIET
                    OUTPUT_STRIP_TRAILING_WHITESPACE)
    message(STATUS "Python command execution status: ${_python_exec_status}")
    message(STATUS "Python command output:           ${_python_exec_output}")
else()
    message(FATAL_ERROR "Python Interpreter not found")
endif()